package com.xxxx;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 批量数据处理
 */
public class Hello09FlinkOperatorDis {
    public static void main(String[] args) throws Exception {
        //创建环境
        StreamExecutionEnvironment environment = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(new Configuration());
        //获取数据源
        DataStreamSource<String> source = environment.socketTextStream("localhost", 18880);
        //开始转换
        //source.rebalance().print("rebalance:");
        //source.shuffle().print("shuffle:");
        source.broadcast().print("broadcast:");
        //source.global().print("global:");

        //执行流
        environment.execute("Hello08FlinkOperatorConnect" + System.currentTimeMillis());

    }
}
